{% extends 'shop_base.html' %}
{% load tags %}

{% block shop_js %}
    <script type="text/javascript" src="{{ STATIC_URL }}js/list.js"></script>
{% endblock shop_js %}

{% block index_content %} 
{{ block.super }}

    <div class="breadcrumb">
        <a href="{% url 'shop:index' %}">全部分类</a>
        <span>></span>
        <a href="#">{{ goods_category.name }}</a>
    </div>

    <div class="main_wrap clearfix">
        <div class="l_wrap fl clearfix">
            <div class="new_goods">
                <h3>新品推荐</h3>
                {% refferral_goods cid %}
            </div>
        </div>

        <div class="r_wrap fr clearfix">
            <div class="sort_bar">
                <a href="{% url 'shop:categorys' cid %}?curr_order=1" {% if curr_order == "1" %}
                   class="active" {% endif %}>默认</a>
                <a href="{% url 'shop:categorys' cid %}?curr_order=2" {% if curr_order == "2" %}
                   class="active" {% endif %}>价格</a>
                <a href="{% url 'shop:categorys' cid %}?curr_order=3" {% if curr_order == "3" %}
                   class="active" {% endif %}>人气</a>
            </div>

            <ul class="goods_type_list clearfix">

                {% for item in page.object_list %}
                    <li>
                        <a href="{% url 'shop:detail' item.id %}"><img src="{{ MEDIA_URL }}{{ item.images }}"></a>
                        <h4><a href="{% url 'shop:detail' item.id %}">{{ item.name }}</a></h4>
                        <div class="operate">
                            <span class="prize">￥{{ item.price }}</span>
                            <span class="unit">{{ item.price }}/{{ item.unit }}/点击:{{ item.click }}</span>
                            <span id="add_url"></span>
                            <a href="#" class="add_goods" title="加入购物车"></a>
                        </div>
                    </li>
                {% endfor %}
            </ul>

            <div class="pagenation">
                {% divide_page curr_page p 'shop:categorys' request.get_full_path kwargs=params %}

            </div>
        </div>
    </div>
{% endblock index_content %}